Many modern software applications display three-dimensional representations of objects and scenes as part of a user interface. Three-dimensional (3D) graphics are used in a wide range of applications including video games, simulations, virtual reality applications, geospatial information applications, and applications for mapping and navigation. In many applications, 3D graphics are more useful than two-dimensional (2D) graphics at depicting real-world environments and locations because the normal interaction between humans and the real-world occurs in three dimensions.
In one form of 3D graphics, different objects in a scene are formed from a large number of polygons. The polygons form shapes and structures in a 3D scene. Since most computing devices only display graphics with a two-dimensional display, the 3D graphics are converted into a rasterized array of two-dimensional pixels for display. The 2D display depicts portions of the three-dimensional scene in a similar manner to how a camera takes a two-dimensional photograph of 3D scenes in the real world. Many 3D graphics systems and application programming interfaces (APIs) including the Open Graphics Library (OpenGL) and the Direct 3D APIs provide common structures and interfaces to specialized graphics hardware for generation of 3D images in an efficient manner. The 3D software interacts with general purpose and specialized digital computing hardware that generates the 3D graphics in an efficient manner. In particular, graphical processing units (GPUs) are hardware components that are configured to generate polygons and other graphical effects that form a 3D scene. Modern computing devices typically execute software with a combination of instructions for a central processing unit (CPU) and the GPU to generate the 3D scene and enable interaction with the 3D scene in some software applications. In some hardware embodiments, the functionality of the CPU and GPU are merged together, physically and optionally logically, into a single a system on a chip (SoC) device.
In modern 3D graphics, the final display includes additional graphical details that go beyond a simple rendering of polygons to provide additional detail and realism. For example, rendered polygons typically receive one or more textures that simulate the appearance of materials in the real world such as wood, stone, metal, cloth, and many other materials. The appearance of a scene is also heavily influenced by the light sources that illuminate the scene. For example, a building appears much different in daylight than at night, and even in daylight the appearance of the building changes based on weather conditions and on the length and orientation of shadows. In 3D graphics, shadows are often generated using one or more mathematical techniques such as ray casting, shadow maps, and shadow volumes in modern 3D hardware and software systems. The existing techniques generate shadows based on the interaction between one or more light sources that illuminate a scene and the sizes and arrangements of objects in the scene that produce the shadows. The different shadow generation techniques include tradeoffs between the accuracy of the generated shadows and the required computational complexity for generating the shadows.
Modern 3D hardware and software systems are capable of producing shadows in graphics, including animated graphics with shadows that move along with the objects that cast the shadows. Despite the capabilities of modern computing devices, the generation of shadows in a 3D scene remains a computationally intensive operation. Many computing devices, which include embedded computing devices such as an in-vehicle computer and mobile electronic devices, which include smartphones, tablets, and GPS navigation devices, have relatively simple hardware capabilities. Some of these devices are unable to generate realistic shadows in an efficient manner. In some cases, even if the device has the hardware capability to produce 3D graphics with shadows using conventional techniques, the added computational complexity results in greater power consumption and a loss in battery life due to the computational requirements for generating the shadows in the 3D scene. Consequently, improved techniques for rendering shadows in 3D scenes in an efficient manner would be beneficial.